package com.atguigu.dao.impl;

import com.atguigu.bean.User;
import com.atguigu.dao.BaseDao;
import com.atguigu.dao.UserDao;

import java.util.List;

public class UserDaoImpl extends BaseDao<User> implements UserDao{
    @Override
    public boolean saveUser(User user) {
        String sql="insert into user values(null,?,?,?)";
        return this.update(sql,user.getUsername(),user.getPassword(),user.getEmil());
    }

    @Override
    public User findUserByUsername(String username) {
        String sql="select * from user where username=?";
        return this.getBean(User.class,sql,username);
    }
}
